/**    
 * @Title: InvalidPropertyException.java  
 * @Package com.zfsoft.util.exception  
 * @Description: 
 * @author Rain   
 * @date 2011-2-23 下午03:53:43  
 * @version V1.0    
 */

package com.company.emenu.exception;

/**
 * @Description:
 * @author Rain
 */
public class InvalidPropertyException extends Exception{

	private static final long serialVersionUID = 1L;

	private Object source;
	private String propertyName;
	private String hintName;

	/**
	 * 构造方法
	 * 
	 * @param object
	 *            对
	 * @param property
	 *            属性名称
	 */
	public InvalidPropertyException(Object source, String propertyName) {
		this(source, propertyName, propertyName);
	}

	/**
	 * 构造方法
	 * 
	 * @param source
	 *            类
	 * @param propertyName
	 *            属性名
	 * @param hintName
	 *            属性名对应提示名
	 * @param message
	 *            提示信息
	 */
	public InvalidPropertyException(Object source, String propertyName,
			String hintName, String message) {
		super(message);
		if (source != null) {
			this.source = source;
		}
		this.propertyName = propertyName;
		this.hintName = hintName;
	}

	/**
	 * 构造方法
	 * 
	 * @param source
	 *            类
	 * @param propertyName
	 *            属性名
	 * @param hintName
	 *            属性名对应提示名
	 */
	public InvalidPropertyException(Object source, String propertyName,
			String hintName) {
		this(source, propertyName, hintName, "\"" + hintName + "\" " + "字段值无效!");
	}

	/**
	 * 读取类名
	 * 
	 * @return
	 */
	public Object getSource() {
		return source;
	}

	/**
	 * 读取属性名称
	 * 
	 * @return
	 */
	public String getPropertyName() {
		return propertyName;
	}

	public String getHintName() {
		return hintName;
	}
}
